
const models = {
  'product.product': {
    extend: BaseClass => {
      class cls extends BaseClass {
      }

      cls.get_theoretical_quantity = async (product_id, location_id, kwargs) => {
        //const { lot_id=null, package_id=null, owner_id=null, to_uom=null } = kwargs
        return cls.call(
          'get_theoretical_quantity',
          [ product_id, location_id ],
          kwargs,
        );
      }
      return cls;
    },
  },

  'stock.scrap': {
    extend: BaseClass => {
      class cls extends BaseClass {
      }


      cls.do_scrap = async (id, fields={}, kwargs={}) => {
        return cls.call_as_write_read({
          method: 'do_scrap',
          args: [ id ],
          kwargs,
        }, fields );
      }

      return cls;
    },

  },

};


export default {
  name: 'stock',
  depends: [ 'product' ],
  models,
};
